<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/react.development.js"></script>
    <script src="lib/react-dom.development.js"></script>
    <script src="lib/babel.min.js"></script>
</head>
<body>
   <div id="app">

   </div> 
</body>
<script type="text/babel">
let products=[
    {id:1,name:"手机"},
    {id:2,name:"电脑"},
    {id:3,name:"鼠标"}
]
function List(props) {
    var list=[]
    for (const item of props.products) {
        let div=<div>{item.name}</div>
        list.push(div)
    }
    console.log(list)
    return <div>{list}</div>
}

ReactDOM.render(<List products={products}/>,document.getElementById("app"))
</script>
</html>